package org.javaboy.demo.controller;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;

@Controller
public class HelloController {

    @RequestMapping("/hello")
    @ResponseBody
    public void hello(@RequestParam("age") int age, @RequestParam("username") String username) {
        System.out.println("age = " + age);
        System.out.println("username = " + username);
        System.out.println("hello");
    }

    @GetMapping("/hello2")
    @ResponseBody
    public void hello2(@RequestParam("birthday") Date birthday) {
        System.out.println("birthday = " + birthday);
    }


}
